<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Order>
 */
class OrderFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'user_id' => \App\Models\User::factory(),
            'order_number' => $this->faker->unique()->numerify('########'),
            'total_amount' => $this->faker->randomFloat(2, 100, 1000),
            'subtotal_amount' => $this->faker->randomFloat(2, 80, 900),
            'shipping_fee' => 10.00,
            'discount_amount' => 0.00,
            'receiver_name' => $this->faker->name(),
            'receiver_phone' => $this->faker->phoneNumber(),
            'receiver_address' => $this->faker->address(),
            'payment_method' => $this->faker->randomElement(['alipay', 'wechat', 'cod']),
            'payment_status' => 'paid',
            'status' => $this->faker->randomElement(['pending', 'processing', 'shipped', 'delivered']),
        ];
    }
}
